﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;

namespace Lokad.Monitoring.Persistence.Entities
{
    public class Report
    {
        [DisplayName("Report name (alphanumerical, 16 char max)")]
        [Required(ErrorMessage = "A name is required.")]
        public virtual string Id { get; set; }

        /// <summary>Indicates whether the latest report generation was faulty or not.</summary>
        public virtual bool IsFault { get; set; }

        [DisplayName("Include in the report the latest N days (zero for no limitation).")]
        [Required(ErrorMessage = "Number of days is required.")]
        [Range(0, 1000000, ErrorMessage = "Incorrect number of days.")]
        public virtual int MaxDays { get; set; }

        [DisplayName("Endpoints included in report (space separated)")]
        [Required(ErrorMessage = "At least one endpoint is required.")]
        public virtual string Endpoints { get; set; }

        [DisplayName("Inclusion message tags (space separated)")]
        public virtual string MessagePlusTags { get; set; }

        [DisplayName("Exclusion message tags (space separated)")]
        public virtual string MessageMinusTags { get; set; }

        [DisplayName("Message tags indicating faults (space separated)")]
        public virtual string MessageFaultTags { get; set; }

        [DisplayName("Inclusion indicator tags (space separated)")]
        public virtual string IndicatorPlusTags { get; set; }

        [DisplayName("Exclusion indicator tags (space separated)")]
        public virtual string IndicatorMinusTags { get; set; }

        [DisplayName("Indicator tags indicating faults (space separated)")]
        public virtual string IndicatorFaultTags { get; set; }

        [DisplayName("Settings for time plot (not used yet)")]
        public virtual string TimePlotSettings { get; set; }

        /// <summary>Optionally containing the pre-generated report (for performance).</summary>
        public virtual byte[] Data { get; set; }

        /// <summary>Last time <see cref="Data"/> was refreshed.</summary>
        public virtual DateTime LastRefreshed { get; set; }
    }
}
